<%--
老师端对任务的增删查改
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>我的任务</title>
  <style>
    table{
      width: 1200px;
    }
    tr,td{
      border: grey 1px ;
    }
    td{
      height: 40px;
    }

    table td{
      height: 60px;
      vertical-align: middle!important;  /*设置文字垂直居中*/
      text-align: center;
    }

    tr,td{border-right:1px solid #888;border-bottom:1px solid #888;padding:5px 15px;}

    th{font-weight:bold;background:#ccc;}

    .con-b .row .lf{
      width: 15%;
      text-align: center;
      padding: 10px;
    }
    .con-b .row .rg{
      width: 85%;
    }

    .con-b tr:nth-of-type(odd){
      background-color: #f2f2f2;
    }

  </style>
  <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
</head>
<body>
<table border="1" cellspacing="0" align="center" class="con-b">
  <thead>
  <%--taskAccount\taskName\taskRequirement\taskDate--%>
  <tr class="row" style="color: black;font-size: 25px" >
    <td class="lf" style="width:10%">任务序号</td>
    <td class="lf" style="width:10%">任务名</td>
    <td class="lf" style="width:30%">任务需求</td>
    <td class="lf">任务截止时间</td>
    <td class="lf" style="width:10%">查看详细</td>
    <td class="lf" style="width:5%">修改</td>
    <td class="lf" style="width:5%">删除</td>
  </tr>
  </thead>
  <tbody><c:forEach items="${arr}" var="task">
  <tr>

      <td class="lf">${task.getTaskAccount()}</td>
      <td class="lf">${task.getTaskName()}</td>
      <td class="lf">${task.getTaskRequirement()}</td>
      <td class="lf">${task.getTaskDate()}</td>
      <td class="lf"> <img src="detail.png" onclick="showDetail('${task.getTaskAccount()}')"> </td>
      <td> <img src="fix.png" onclick="fixThisTask('${task.getTaskAccount()}')" style="left: 30px"></td>
      <td> <img src="drop.png" onclick="delThisTask('${task.getTaskAccount()}')" style="left: 30px"></td>

  </tr></c:forEach>
  <tr>
    <td style="width: 100px" onclick="addTask()">添加任务</td>
    <td><img src="insert.png" onclick="addTask()"></td>
  </tr>

  </tbody>


</table>

</body>

</html>



<script>
  function showDetail(taskAccount){
      location.href="tea.action?action=goShowDetail&taskAccount="+taskAccount;
  }

  function delThisTask(taskAccount){
      var flag= confirm("确认删除")
      if(flag) {
          location.href = "tea.action?action=delThisTask&taskAccount=" + taskAccount;
          alert("删除成功")
      }
      else
      alert("取消删除")

  }

  function fixThisTask(taskAccount) {
      location.href="tea.action?action=fixThisTask&taskAccount="+taskAccount;
  }

  function addTask(){
      location.href="tea.action?action=goAddTask";
  }
</script>

